<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-purchases-edit" th:object="${purchases}">
        <input id="id" name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label"><span class="must_be_color">*</span>productName</label>
            <div class="col-sm-8">
                <input id="productId" name="productId" th:field="*{productName}" class="form-control" disabled
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span class="must_be_color">*</span>mainSKU</label>
            <div class="col-sm-8">
                <input id="mainSKU" name="mainSKU" th:field="*{mainSKU}" class="form-control" disabled type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span class="must_be_color">*</span>quantityShipped</label>
            <div class="col-sm-8">
                <input id="purchaseQuantity" name="purchaseQuantity" th:field="*{purchaseQuantity}" class="form-control" disabled
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span class="must_be_color">*</span>overseasExpress</label>
            <div class="col-sm-8">
                <select class="form-control" id="overseasExpressCompanyID" name="overseasExpressCompanyID"
                        th:with="type=${@dict.getType('erp_overseas_courier')}">
                    <option th:each="dict : ${type}" th:text="${dict['dictLabel']}"
                            th:value="${dict['dictValue']}" th:field="*{overseasExpressCompanyID}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span class="must_be_color">*</span>overseasExpressNumber</label>
            <div class="col-sm-8">
                <input id="overseasExpressNo" name="overseasExpressNo" th:field="*{overseasExpressNo}" class="form-control"
                       type="text" autocomplete="off">
            </div>
        </div>
        <div class="form-group">
            <!--发往海外仓标识-->
        <input id="chinaReceived" name="chinaReceived" value="1" class="form-control"
               type="hidden">
        </div>
        <!--<div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input id="bz" name="bz" th:field="*{bz}" class="form-control" type="text">
            </div>
        </div>-->
        <div class="form-group">
            <div class="form-control-static col-sm-offset-9">
                <button type="submit" class="btn btn-primary">submit</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">close</button>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<!--<script th:src="@{/ajax/libs/select/select2.js}"></script>-->
<script type="text/javascript">
    var prefix = ctx + "module/purchases"
    $("#form-purchases-edit").validate({
        rules: {
            purchaseQuantity: {
                required: true,
            },
            chinaExpressNo: {
                required: true,
            }
        },
        messages: {
            "purchaseQuantity": {
                remote: "采购数量不能为空！"
            },
            "chinaExpressNo": {
                remote: "国内快递单号不能为空！"
            }
        },
        submitHandler: function (form) {
            $.operate.save(prefix + "/edit_overseas", $('#form-purchases-edit').serialize());
        }
    });
</script>
</body>
</html>
